{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "73dbed65-c3b5-4aed-a192-3dafdc31c509",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import torch\n",
    "torch.cuda.is_available()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e5c3f4f3-530e-453e-8308-afc266ec5de5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/root/animation_training/src/latte\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/opt/conda/lib/python3.10/site-packages/IPython/core/magics/osm.py:417: UserWarning: using dhist requires you to install the `pickleshare` library.\n",
      "  self.shell.db['dhist'] = compress_dhist(dhist)[-100:]\n"
     ]
    }
   ],
   "source": [
    "%cd /root/animation_training/src/latte"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "aac35a3d-cffc-4cb1-91f1-ef394bd83791",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/opt/conda/lib/python3.10/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.\n",
      "  torch.utils._pytree._register_pytree_node(\n",
      "Starting rank=0, local rank=0, seed=3407, world_size=1.\n",
      "[2024-02-29 03:33:59] Experiment directory created at ./results_img/014-LatteT2V-F16S1-gameanim-Xfor-Gc\n",
      "\u001b[34m\u001b[1mwandb\u001b[0m: Currently logged in as: \u001b[33mlyo-gavin\u001b[0m. Use \u001b[1m`wandb login --relogin`\u001b[0m to force relogin\n",
      "\u001b[34m\u001b[1mwandb\u001b[0m: Tracking run with wandb version 0.16.3\n",
      "\u001b[34m\u001b[1mwandb\u001b[0m: Run data is saved locally in \u001b[35m\u001b[1m/root/animation_training/src/latte/wandb/run-20240229_033400-nm572w30\u001b[0m\n",
      "\u001b[34m\u001b[1mwandb\u001b[0m: Run \u001b[1m`wandb offline`\u001b[0m to turn off syncing.\n",
      "\u001b[34m\u001b[1mwandb\u001b[0m: Syncing run \u001b[33m./results_img/014-LatteT2V-F16S1-gameanim-Xfor-Gc\u001b[0m\n",
      "\u001b[34m\u001b[1mwandb\u001b[0m: ⭐️ View project at \u001b[34m\u001b[4mhttps://wandb.ai/lyo-gavin/latte_t2v\u001b[0m\n",
      "\u001b[34m\u001b[1mwandb\u001b[0m: 🚀 View run at \u001b[34m\u001b[4mhttps://wandb.ai/lyo-gavin/latte_t2v/runs/nm572w30\u001b[0m\n",
      "[2024-02-29 03:34:37] Ignoring: model\n",
      "[2024-02-29 03:34:37] Successfully Load 0.0% original pretrained model weights \n",
      "[2024-02-29 03:34:37] Successfully load model at /root/pretrained_Latte/t2v.pt!\n",
      "[2024-02-29 03:34:37] Using Xformers!\n",
      "[2024-02-29 03:34:37] Using gradient checkpointing!\n",
      "Loading checkpoint shards: 100%|██████████████████| 4/4 [00:08<00:00,  2.11s/it]\n",
      "[2024-02-29 03:34:57] Model Parameters: 1,057,246,880\n",
      "loading annotations from /root/merged_run_021124/animdiff_training_021024_synced2_reresmpl_train_val.csv ...\n",
      "[2024-02-29 03:34:57] Dataset contains 852)\n",
      "ema_model: LatteT2V(\n",
      "  (pos_embed): PatchEmbed(\n",
      "    (proj): Conv2d(4, 1152, kernel_size=(2, 2), stride=(2, 2))\n",
      "  )\n",
      "  (transformer_blocks): ModuleList(\n",
      "    (0-27): 28 x BasicTransformerBlock(\n",
      "      (norm1): LayerNorm((1152,), eps=1e-06, elementwise_affine=False)\n",
      "      (attn1): Attention(\n",
      "        (to_q): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_k): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_v): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_out): ModuleList(\n",
      "          (0): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "          (1): Dropout(p=0.0, inplace=False)\n",
      "        )\n",
      "      )\n",
      "      (norm2): LayerNorm((1152,), eps=1e-06, elementwise_affine=False)\n",
      "      (attn2): Attention(\n",
      "        (to_q): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_k): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_v): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_out): ModuleList(\n",
      "          (0): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "          (1): Dropout(p=0.0, inplace=False)\n",
      "        )\n",
      "      )\n",
      "      (ff): FeedForward(\n",
      "        (net): ModuleList(\n",
      "          (0): GELU(\n",
      "            (proj): Linear(in_features=1152, out_features=4608, bias=True)\n",
      "          )\n",
      "          (1): Dropout(p=0.0, inplace=False)\n",
      "          (2): LoRACompatibleLinear(in_features=4608, out_features=1152, bias=True)\n",
      "        )\n",
      "      )\n",
      "    )\n",
      "  )\n",
      "  (temporal_transformer_blocks): ModuleList(\n",
      "    (0-27): 28 x BasicTransformerBlock_(\n",
      "      (norm1): LayerNorm((1152,), eps=1e-06, elementwise_affine=False)\n",
      "      (attn1): Attention(\n",
      "        (to_q): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_k): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_v): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_out): ModuleList(\n",
      "          (0): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "          (1): Dropout(p=0.0, inplace=False)\n",
      "        )\n",
      "      )\n",
      "      (norm3): LayerNorm((1152,), eps=1e-06, elementwise_affine=False)\n",
      "      (ff): FeedForward(\n",
      "        (net): ModuleList(\n",
      "          (0): GELU(\n",
      "            (proj): Linear(in_features=1152, out_features=4608, bias=True)\n",
      "          )\n",
      "          (1): Dropout(p=0.0, inplace=False)\n",
      "          (2): LoRACompatibleLinear(in_features=4608, out_features=1152, bias=True)\n",
      "        )\n",
      "      )\n",
      "    )\n",
      "  )\n",
      "  (norm_out): LayerNorm((1152,), eps=1e-06, elementwise_affine=False)\n",
      "  (proj_out): Linear(in_features=1152, out_features=32, bias=True)\n",
      "  (adaln_single): AdaLayerNormSingle(\n",
      "    (emb): CombinedTimestepSizeEmbeddings(\n",
      "      (time_proj): Timesteps()\n",
      "      (timestep_embedder): TimestepEmbedding(\n",
      "        (linear_1): LoRACompatibleLinear(in_features=256, out_features=1152, bias=True)\n",
      "        (act): SiLU()\n",
      "        (linear_2): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "      )\n",
      "    )\n",
      "    (silu): SiLU()\n",
      "    (linear): Linear(in_features=1152, out_features=6912, bias=True)\n",
      "  )\n",
      "  (caption_projection): CaptionProjection(\n",
      "    (linear_1): Linear(in_features=4096, out_features=1152, bias=True)\n",
      "    (act_1): GELU(approximate='tanh')\n",
      "    (linear_2): Linear(in_features=1152, out_features=1152, bias=True)\n",
      "  )\n",
      ")\n",
      "model: LatteT2V(\n",
      "  (pos_embed): PatchEmbed(\n",
      "    (proj): Conv2d(4, 1152, kernel_size=(2, 2), stride=(2, 2))\n",
      "  )\n",
      "  (transformer_blocks): ModuleList(\n",
      "    (0-27): 28 x BasicTransformerBlock(\n",
      "      (norm1): LayerNorm((1152,), eps=1e-06, elementwise_affine=False)\n",
      "      (attn1): Attention(\n",
      "        (to_q): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_k): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_v): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_out): ModuleList(\n",
      "          (0): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "          (1): Dropout(p=0.0, inplace=False)\n",
      "        )\n",
      "      )\n",
      "      (norm2): LayerNorm((1152,), eps=1e-06, elementwise_affine=False)\n",
      "      (attn2): Attention(\n",
      "        (to_q): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_k): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_v): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_out): ModuleList(\n",
      "          (0): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "          (1): Dropout(p=0.0, inplace=False)\n",
      "        )\n",
      "      )\n",
      "      (ff): FeedForward(\n",
      "        (net): ModuleList(\n",
      "          (0): GELU(\n",
      "            (proj): Linear(in_features=1152, out_features=4608, bias=True)\n",
      "          )\n",
      "          (1): Dropout(p=0.0, inplace=False)\n",
      "          (2): LoRACompatibleLinear(in_features=4608, out_features=1152, bias=True)\n",
      "        )\n",
      "      )\n",
      "    )\n",
      "  )\n",
      "  (temporal_transformer_blocks): ModuleList(\n",
      "    (0-27): 28 x BasicTransformerBlock_(\n",
      "      (norm1): LayerNorm((1152,), eps=1e-06, elementwise_affine=False)\n",
      "      (attn1): Attention(\n",
      "        (to_q): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_k): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_v): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "        (to_out): ModuleList(\n",
      "          (0): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "          (1): Dropout(p=0.0, inplace=False)\n",
      "        )\n",
      "      )\n",
      "      (norm3): LayerNorm((1152,), eps=1e-06, elementwise_affine=False)\n",
      "      (ff): FeedForward(\n",
      "        (net): ModuleList(\n",
      "          (0): GELU(\n",
      "            (proj): Linear(in_features=1152, out_features=4608, bias=True)\n",
      "          )\n",
      "          (1): Dropout(p=0.0, inplace=False)\n",
      "          (2): LoRACompatibleLinear(in_features=4608, out_features=1152, bias=True)\n",
      "        )\n",
      "      )\n",
      "    )\n",
      "  )\n",
      "  (norm_out): LayerNorm((1152,), eps=1e-06, elementwise_affine=False)\n",
      "  (proj_out): Linear(in_features=1152, out_features=32, bias=True)\n",
      "  (adaln_single): AdaLayerNormSingle(\n",
      "    (emb): CombinedTimestepSizeEmbeddings(\n",
      "      (time_proj): Timesteps()\n",
      "      (timestep_embedder): TimestepEmbedding(\n",
      "        (linear_1): LoRACompatibleLinear(in_features=256, out_features=1152, bias=True)\n",
      "        (act): SiLU()\n",
      "        (linear_2): LoRACompatibleLinear(in_features=1152, out_features=1152, bias=True)\n",
      "      )\n",
      "    )\n",
      "    (silu): SiLU()\n",
      "    (linear): Linear(in_features=1152, out_features=6912, bias=True)\n",
      "  )\n",
      "  (caption_projection): CaptionProjection(\n",
      "    (linear_1): Linear(in_features=4096, out_features=1152, bias=True)\n",
      "    (act_1): GELU(approximate='tanh')\n",
      "    (linear_2): Linear(in_features=1152, out_features=1152, bias=True)\n",
      "  )\n",
      ")\n",
      "/opt/conda/lib/python3.10/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.\n",
      "  torch.utils._pytree._register_pytree_node(\n",
      "Traceback (most recent call last):\n",
      "  File \"/root/animation_training/src/latte/train_with_img_t2v.py\", line 702, in <module>\n",
      "    main(OmegaConf.load(args.config))\n",
      "  File \"/root/animation_training/src/latte/train_with_img_t2v.py\", line 574, in main\n",
      "    for step, video_data in enumerate(loader):\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 631, in __next__\n",
      "    data = self._next_data()\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 1346, in _next_data\n",
      "    return self._process_data(data)\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 1372, in _process_data\n",
      "    data.reraise()\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/_utils.py\", line 722, in reraise\n",
      "    raise exception\n",
      "AssertionError: Caught AssertionError in DataLoader worker process 0.\n",
      "Original Traceback (most recent call last):\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py\", line 308, in _worker_loop\n",
      "    data = fetcher.fetch(index)\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py\", line 51, in fetch\n",
      "    data = [self.dataset[idx] for idx in possibly_batched_index]\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py\", line 51, in <listcomp>\n",
      "    data = [self.dataset[idx] for idx in possibly_batched_index]\n",
      "  File \"/root/animation_training/src/latte/datasets/gameanim_image_datasets.py\", line 107, in __getitem__\n",
      "    assert end_frame_ind - start_frame_ind >= self.target_video_len\n",
      "AssertionError\n",
      "\n",
      "Traceback (most recent call last):\n",
      "  File \"/root/animation_training/src/latte/train_with_img_t2v.py\", line 702, in <module>\n",
      "    main(OmegaConf.load(args.config))\n",
      "  File \"/root/animation_training/src/latte/train_with_img_t2v.py\", line 574, in main\n",
      "    for step, video_data in enumerate(loader):\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 631, in __next__\n",
      "    data = self._next_data()\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 1346, in _next_data\n",
      "    return self._process_data(data)\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 1372, in _process_data\n",
      "    data.reraise()\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/_utils.py\", line 722, in reraise\n",
      "    raise exception\n",
      "AssertionError: Caught AssertionError in DataLoader worker process 0.\n",
      "Original Traceback (most recent call last):\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py\", line 308, in _worker_loop\n",
      "    data = fetcher.fetch(index)\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py\", line 51, in fetch\n",
      "    data = [self.dataset[idx] for idx in possibly_batched_index]\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py\", line 51, in <listcomp>\n",
      "    data = [self.dataset[idx] for idx in possibly_batched_index]\n",
      "  File \"/root/animation_training/src/latte/datasets/gameanim_image_datasets.py\", line 107, in __getitem__\n",
      "    assert end_frame_ind - start_frame_ind >= self.target_video_len\n",
      "AssertionError\n",
      "\n",
      "\u001b[34m\u001b[1mwandb\u001b[0m: 🚀 View run \u001b[33m./results_img/014-LatteT2V-F16S1-gameanim-Xfor-Gc\u001b[0m at: \u001b[34m\u001b[4mhttps://wandb.ai/lyo-gavin/latte_t2v/runs/nm572w30\u001b[0m\n",
      "\u001b[34m\u001b[1mwandb\u001b[0m: ️⚡ View job at \u001b[34m\u001b[4mhttps://wandb.ai/lyo-gavin/latte_t2v/jobs/QXJ0aWZhY3RDb2xsZWN0aW9uOjE0Mzk3ODc1NQ==/version_details/v10\u001b[0m\n",
      "\u001b[34m\u001b[1mwandb\u001b[0m: Synced 6 W&B file(s), 0 media file(s), 2 artifact file(s) and 0 other file(s)\n",
      "\u001b[34m\u001b[1mwandb\u001b[0m: Find logs at: \u001b[35m\u001b[1m./wandb/run-20240229_033400-nm572w30/logs\u001b[0m\n",
      "[2024-02-29 03:35:16,027] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: 1) local_rank: 0 (pid: 9026) of binary: /opt/conda/bin/python\n",
      "Traceback (most recent call last):\n",
      "  File \"/opt/conda/bin/torchrun\", line 33, in <module>\n",
      "    sys.exit(load_entry_point('torch==2.2.0', 'console_scripts', 'torchrun')())\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py\", line 347, in wrapper\n",
      "    return f(*args, **kwargs)\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/distributed/run.py\", line 812, in main\n",
      "    run(args)\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/distributed/run.py\", line 803, in run\n",
      "    elastic_launch(\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/distributed/launcher/api.py\", line 135, in __call__\n",
      "    return launch_agent(self._config, self._entrypoint, list(args))\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/distributed/launcher/api.py\", line 268, in launch_agent\n",
      "    raise ChildFailedError(\n",
      "torch.distributed.elastic.multiprocessing.errors.ChildFailedError: \n",
      "============================================================\n",
      "train_with_img_t2v.py FAILED\n",
      "------------------------------------------------------------\n",
      "Failures:\n",
      "  <NO_OTHER_FAILURES>\n",
      "------------------------------------------------------------\n",
      "Root Cause (first observed failure):\n",
      "[0]:\n",
      "  time      : 2024-02-29_03:35:16\n",
      "  host      : f1dc5a5f3720\n",
      "  rank      : 0 (local_rank: 0)\n",
      "  exitcode  : 1 (pid: 9026)\n",
      "  error_file: <N/A>\n",
      "  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html\n",
      "============================================================\n"
     ]
    }
   ],
   "source": [
    "!torchrun --nnodes=1 --nproc_per_node=1 train_with_img_t2v.py --config  ./configs/t2v/t2v_img_train.yaml "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "36c3d0cf-7fbf-43d0-be41-230e5afc8f35",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting imageio-ffmpeg\n",
      "  Using cached imageio_ffmpeg-0.4.9-py3-none-manylinux2010_x86_64.whl.metadata (1.7 kB)\n",
      "Requirement already satisfied: setuptools in /opt/conda/lib/python3.10/site-packages (from imageio-ffmpeg) (68.2.2)\n",
      "Using cached imageio_ffmpeg-0.4.9-py3-none-manylinux2010_x86_64.whl (26.9 MB)\n",
      "Installing collected packages: imageio-ffmpeg\n",
      "Successfully installed imageio-ffmpeg-0.4.9\n",
      "\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n",
      "\u001b[0m"
     ]
    }
   ],
   "source": [
    "!pip install imageio-ffmpeg"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "669590fa-6496-45c2-b7a4-a38c861301be",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting timm\n",
      "  Using cached timm-0.9.16-py3-none-any.whl.metadata (38 kB)\n",
      "Collecting diffusers==0.24.0 (from diffusers[torch]==0.24.0)\n",
      "  Using cached diffusers-0.24.0-py3-none-any.whl.metadata (18 kB)\n",
      "Collecting accelerate\n",
      "  Using cached accelerate-0.27.2-py3-none-any.whl.metadata (18 kB)\n",
      "Collecting tensorboard\n",
      "  Using cached tensorboard-2.16.2-py3-none-any.whl.metadata (1.6 kB)\n",
      "Collecting einops\n",
      "  Using cached einops-0.7.0-py3-none-any.whl.metadata (13 kB)\n",
      "Collecting transformers\n",
      "  Using cached transformers-4.38.1-py3-none-any.whl.metadata (131 kB)\n",
      "Collecting av\n",
      "  Downloading av-11.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.5 kB)\n",
      "Collecting scikit-image\n",
      "  Downloading scikit_image-0.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (13 kB)\n",
      "Collecting decord\n",
      "  Using cached decord-0.6.0-py3-none-manylinux2010_x86_64.whl.metadata (422 bytes)\n",
      "Collecting pandas\n",
      "  Downloading pandas-2.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)\n",
      "Requirement already satisfied: imageio-ffmpeg in /opt/conda/lib/python3.10/site-packages (0.4.9)\n",
      "Collecting omegaconf\n",
      "  Using cached omegaconf-2.3.0-py3-none-any.whl.metadata (3.9 kB)\n",
      "Collecting wandb\n",
      "  Using cached wandb-0.16.3-py3-none-any.whl.metadata (9.9 kB)\n",
      "Collecting sentencepiece\n",
      "  Downloading sentencepiece-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (7.7 kB)\n",
      "Requirement already satisfied: beautifulsoup4 in /opt/conda/lib/python3.10/site-packages (4.12.2)\n",
      "Requirement already satisfied: Pillow in /opt/conda/lib/python3.10/site-packages (from diffusers==0.24.0->diffusers[torch]==0.24.0) (10.0.1)\n",
      "Requirement already satisfied: filelock in /opt/conda/lib/python3.10/site-packages (from diffusers==0.24.0->diffusers[torch]==0.24.0) (3.13.1)\n",
      "Collecting huggingface-hub>=0.19.4 (from diffusers==0.24.0->diffusers[torch]==0.24.0)\n",
      "  Using cached huggingface_hub-0.21.2-py3-none-any.whl.metadata (13 kB)\n",
      "Collecting importlib-metadata (from diffusers==0.24.0->diffusers[torch]==0.24.0)\n",
      "  Using cached importlib_metadata-7.0.1-py3-none-any.whl.metadata (4.9 kB)\n",
      "Requirement already satisfied: numpy in /opt/conda/lib/python3.10/site-packages (from diffusers==0.24.0->diffusers[torch]==0.24.0) (1.26.3)\n",
      "Collecting regex!=2019.12.17 (from diffusers==0.24.0->diffusers[torch]==0.24.0)\n",
      "  Downloading regex-2023.12.25-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (40 kB)\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m40.9/40.9 kB\u001b[0m \u001b[31m15.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hRequirement already satisfied: requests in /opt/conda/lib/python3.10/site-packages (from diffusers==0.24.0->diffusers[torch]==0.24.0) (2.31.0)\n",
      "Collecting safetensors>=0.3.1 (from diffusers==0.24.0->diffusers[torch]==0.24.0)\n",
      "  Downloading safetensors-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.8 kB)\n",
      "Requirement already satisfied: torch>=1.4 in /opt/conda/lib/python3.10/site-packages (from diffusers[torch]==0.24.0) (2.2.0)\n",
      "Requirement already satisfied: torchvision in /opt/conda/lib/python3.10/site-packages (from timm) (0.17.0)\n",
      "Requirement already satisfied: pyyaml in /opt/conda/lib/python3.10/site-packages (from timm) (6.0.1)\n",
      "Requirement already satisfied: packaging>=20.0 in /opt/conda/lib/python3.10/site-packages (from accelerate) (23.1)\n",
      "Requirement already satisfied: psutil in /opt/conda/lib/python3.10/site-packages (from accelerate) (5.9.0)\n",
      "Collecting absl-py>=0.4 (from tensorboard)\n",
      "  Using cached absl_py-2.1.0-py3-none-any.whl.metadata (2.3 kB)\n",
      "Collecting grpcio>=1.48.2 (from tensorboard)\n",
      "  Downloading grpcio-1.62.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.0 kB)\n",
      "Collecting markdown>=2.6.8 (from tensorboard)\n",
      "  Using cached Markdown-3.5.2-py3-none-any.whl.metadata (7.0 kB)\n",
      "Collecting protobuf!=4.24.0,>=3.19.6 (from tensorboard)\n",
      "  Using cached protobuf-4.25.3-cp37-abi3-manylinux2014_x86_64.whl.metadata (541 bytes)\n",
      "Requirement already satisfied: setuptools>=41.0.0 in /opt/conda/lib/python3.10/site-packages (from tensorboard) (68.2.2)\n",
      "Requirement already satisfied: six>1.9 in /opt/conda/lib/python3.10/site-packages (from tensorboard) (1.16.0)\n",
      "Collecting tensorboard-data-server<0.8.0,>=0.7.0 (from tensorboard)\n",
      "  Using cached tensorboard_data_server-0.7.2-py3-none-manylinux_2_31_x86_64.whl.metadata (1.1 kB)\n",
      "Collecting werkzeug>=1.0.1 (from tensorboard)\n",
      "  Using cached werkzeug-3.0.1-py3-none-any.whl.metadata (4.1 kB)\n",
      "Collecting tokenizers<0.19,>=0.14 (from transformers)\n",
      "  Downloading tokenizers-0.15.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.7 kB)\n",
      "Requirement already satisfied: tqdm>=4.27 in /opt/conda/lib/python3.10/site-packages (from transformers) (4.65.0)\n",
      "Collecting scipy>=1.8 (from scikit-image)\n",
      "  Downloading scipy-1.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m60.4/60.4 kB\u001b[0m \u001b[31m25.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hRequirement already satisfied: networkx>=2.8 in /opt/conda/lib/python3.10/site-packages (from scikit-image) (3.1)\n",
      "Collecting imageio>=2.27 (from scikit-image)\n",
      "  Using cached imageio-2.34.0-py3-none-any.whl.metadata (4.9 kB)\n",
      "Collecting tifffile>=2022.8.12 (from scikit-image)\n",
      "  Using cached tifffile-2024.2.12-py3-none-any.whl.metadata (31 kB)\n",
      "Collecting lazy_loader>=0.3 (from scikit-image)\n",
      "  Using cached lazy_loader-0.3-py3-none-any.whl.metadata (4.3 kB)\n",
      "Requirement already satisfied: python-dateutil>=2.8.2 in /opt/conda/lib/python3.10/site-packages (from pandas) (2.8.2)\n",
      "Requirement already satisfied: pytz>=2020.1 in /opt/conda/lib/python3.10/site-packages (from pandas) (2023.3.post1)\n",
      "Collecting tzdata>=2022.7 (from pandas)\n",
      "  Using cached tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)\n",
      "Collecting antlr4-python3-runtime==4.9.* (from omegaconf)\n",
      "  Using cached antlr4-python3-runtime-4.9.3.tar.gz (117 kB)\n",
      "  Preparing metadata (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25hRequirement already satisfied: Click!=8.0.0,>=7.1 in /opt/conda/lib/python3.10/site-packages (from wandb) (8.1.7)\n",
      "Collecting GitPython!=3.1.29,>=1.0.0 (from wandb)\n",
      "  Using cached GitPython-3.1.42-py3-none-any.whl.metadata (12 kB)\n",
      "Collecting sentry-sdk>=1.0.0 (from wandb)\n",
      "  Using cached sentry_sdk-1.40.6-py2.py3-none-any.whl.metadata (9.7 kB)\n",
      "Collecting docker-pycreds>=0.4.0 (from wandb)\n",
      "  Using cached docker_pycreds-0.4.0-py2.py3-none-any.whl (9.0 kB)\n",
      "Collecting setproctitle (from wandb)\n",
      "  Downloading setproctitle-1.3.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (9.9 kB)\n",
      "Collecting appdirs>=1.4.3 (from wandb)\n",
      "  Using cached appdirs-1.4.4-py2.py3-none-any.whl.metadata (9.0 kB)\n",
      "Requirement already satisfied: soupsieve>1.2 in /opt/conda/lib/python3.10/site-packages (from beautifulsoup4) (2.5)\n",
      "Collecting gitdb<5,>=4.0.1 (from GitPython!=3.1.29,>=1.0.0->wandb)\n",
      "  Using cached gitdb-4.0.11-py3-none-any.whl.metadata (1.2 kB)\n",
      "Requirement already satisfied: fsspec>=2023.5.0 in /opt/conda/lib/python3.10/site-packages (from huggingface-hub>=0.19.4->diffusers==0.24.0->diffusers[torch]==0.24.0) (2023.12.2)\n",
      "Requirement already satisfied: typing-extensions>=3.7.4.3 in /opt/conda/lib/python3.10/site-packages (from huggingface-hub>=0.19.4->diffusers==0.24.0->diffusers[torch]==0.24.0) (4.9.0)\n",
      "Requirement already satisfied: charset-normalizer<4,>=2 in /opt/conda/lib/python3.10/site-packages (from requests->diffusers==0.24.0->diffusers[torch]==0.24.0) (2.0.4)\n",
      "Requirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.10/site-packages (from requests->diffusers==0.24.0->diffusers[torch]==0.24.0) (3.4)\n",
      "Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/conda/lib/python3.10/site-packages (from requests->diffusers==0.24.0->diffusers[torch]==0.24.0) (1.26.18)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.10/site-packages (from requests->diffusers==0.24.0->diffusers[torch]==0.24.0) (2023.11.17)\n",
      "Requirement already satisfied: sympy in /opt/conda/lib/python3.10/site-packages (from torch>=1.4->diffusers[torch]==0.24.0) (1.12)\n",
      "Requirement already satisfied: jinja2 in /opt/conda/lib/python3.10/site-packages (from torch>=1.4->diffusers[torch]==0.24.0) (3.1.2)\n",
      "Requirement already satisfied: MarkupSafe>=2.1.1 in /opt/conda/lib/python3.10/site-packages (from werkzeug>=1.0.1->tensorboard) (2.1.3)\n",
      "Collecting zipp>=0.5 (from importlib-metadata->diffusers==0.24.0->diffusers[torch]==0.24.0)\n",
      "  Using cached zipp-3.17.0-py3-none-any.whl.metadata (3.7 kB)\n",
      "Collecting smmap<6,>=3.0.1 (from gitdb<5,>=4.0.1->GitPython!=3.1.29,>=1.0.0->wandb)\n",
      "  Using cached smmap-5.0.1-py3-none-any.whl.metadata (4.3 kB)\n",
      "Requirement already satisfied: mpmath>=0.19 in /opt/conda/lib/python3.10/site-packages (from sympy->torch>=1.4->diffusers[torch]==0.24.0) (1.3.0)\n",
      "Using cached diffusers-0.24.0-py3-none-any.whl (1.8 MB)\n",
      "Using cached timm-0.9.16-py3-none-any.whl (2.2 MB)\n",
      "Using cached accelerate-0.27.2-py3-none-any.whl (279 kB)\n",
      "Using cached tensorboard-2.16.2-py3-none-any.whl (5.5 MB)\n",
      "Using cached einops-0.7.0-py3-none-any.whl (44 kB)\n",
      "Using cached transformers-4.38.1-py3-none-any.whl (8.5 MB)\n",
      "Downloading av-11.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (32.9 MB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m32.9/32.9 MB\u001b[0m \u001b[31m46.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
      "\u001b[?25hDownloading scikit_image-0.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m14.7/14.7 MB\u001b[0m \u001b[31m54.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
      "\u001b[?25hUsing cached decord-0.6.0-py3-none-manylinux2010_x86_64.whl (13.6 MB)\n",
      "Downloading pandas-2.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m13.0/13.0 MB\u001b[0m \u001b[31m57.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
      "\u001b[?25hUsing cached omegaconf-2.3.0-py3-none-any.whl (79 kB)\n",
      "Using cached wandb-0.16.3-py3-none-any.whl (2.2 MB)\n",
      "Downloading sentencepiece-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m62.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hUsing cached absl_py-2.1.0-py3-none-any.whl (133 kB)\n",
      "Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)\n",
      "Using cached GitPython-3.1.42-py3-none-any.whl (195 kB)\n",
      "Downloading grpcio-1.62.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.5/5.5 MB\u001b[0m \u001b[31m61.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
      "\u001b[?25hUsing cached huggingface_hub-0.21.2-py3-none-any.whl (346 kB)\n",
      "Using cached imageio-2.34.0-py3-none-any.whl (313 kB)\n",
      "Using cached lazy_loader-0.3-py3-none-any.whl (9.1 kB)\n",
      "Using cached Markdown-3.5.2-py3-none-any.whl (103 kB)\n",
      "Using cached protobuf-4.25.3-cp37-abi3-manylinux2014_x86_64.whl (294 kB)\n",
      "Downloading regex-2023.12.25-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (773 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m774.0/774.0 kB\u001b[0m \u001b[31m64.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hDownloading safetensors-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m63.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hDownloading scipy-1.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (38.4 MB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m38.4/38.4 MB\u001b[0m \u001b[31m46.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
      "\u001b[?25hUsing cached sentry_sdk-1.40.6-py2.py3-none-any.whl (258 kB)\n",
      "Using cached tensorboard_data_server-0.7.2-py3-none-manylinux_2_31_x86_64.whl (6.6 MB)\n",
      "Using cached tifffile-2024.2.12-py3-none-any.whl (224 kB)\n",
      "Downloading tokenizers-0.15.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.6/3.6 MB\u001b[0m \u001b[31m58.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
      "\u001b[?25hUsing cached tzdata-2024.1-py2.py3-none-any.whl (345 kB)\n",
      "Using cached werkzeug-3.0.1-py3-none-any.whl (226 kB)\n",
      "Using cached importlib_metadata-7.0.1-py3-none-any.whl (23 kB)\n",
      "Downloading setproctitle-1.3.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30 kB)\n",
      "Using cached gitdb-4.0.11-py3-none-any.whl (62 kB)\n",
      "Using cached zipp-3.17.0-py3-none-any.whl (7.4 kB)\n",
      "Using cached smmap-5.0.1-py3-none-any.whl (24 kB)\n",
      "Building wheels for collected packages: antlr4-python3-runtime\n",
      "  Building wheel for antlr4-python3-runtime (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144554 sha256=0c5656d097da464e4a4232ec97c9b8c9599744b09849eff925f4ea488fc5d37e\n",
      "  Stored in directory: /root/.cache/pip/wheels/12/93/dd/1f6a127edc45659556564c5730f6d4e300888f4bca2d4c5a88\n",
      "Successfully built antlr4-python3-runtime\n",
      "Installing collected packages: sentencepiece, appdirs, antlr4-python3-runtime, zipp, werkzeug, tzdata, tifffile, tensorboard-data-server, smmap, setproctitle, sentry-sdk, scipy, safetensors, regex, protobuf, omegaconf, markdown, lazy_loader, imageio, grpcio, einops, docker-pycreds, decord, av, absl-py, tensorboard, scikit-image, pandas, importlib-metadata, huggingface-hub, gitdb, tokenizers, GitPython, diffusers, accelerate, wandb, transformers, timm\n",
      "Successfully installed GitPython-3.1.42 absl-py-2.1.0 accelerate-0.27.2 antlr4-python3-runtime-4.9.3 appdirs-1.4.4 av-11.0.0 decord-0.6.0 diffusers-0.24.0 docker-pycreds-0.4.0 einops-0.7.0 gitdb-4.0.11 grpcio-1.62.0 huggingface-hub-0.21.2 imageio-2.34.0 importlib-metadata-7.0.1 lazy_loader-0.3 markdown-3.5.2 omegaconf-2.3.0 pandas-2.2.1 protobuf-4.25.3 regex-2023.12.25 safetensors-0.4.2 scikit-image-0.22.0 scipy-1.12.0 sentencepiece-0.2.0 sentry-sdk-1.40.6 setproctitle-1.3.3 smmap-5.0.1 tensorboard-2.16.2 tensorboard-data-server-0.7.2 tifffile-2024.2.12 timm-0.9.16 tokenizers-0.15.2 transformers-4.38.1 tzdata-2024.1 wandb-0.16.3 werkzeug-3.0.1 zipp-3.17.0\n",
      "\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n",
      "\u001b[0m"
     ]
    }
   ],
   "source": [
    "!pip install \\\n",
    "    timm \\\n",
    "    diffusers[torch]==0.24.0 \\\n",
    "    accelerate \\\n",
    "    tensorboard \\\n",
    "    einops \\\n",
    "    transformers \\\n",
    "    av \\\n",
    "    scikit-image \\\n",
    "    decord \\\n",
    "    pandas \\\n",
    "    imageio-ffmpeg \\\n",
    "    omegaconf \\\n",
    "    wandb \\\n",
    "    accelerate \\\n",
    "    sentencepiece \\\n",
    "    beautifulsoup4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "ed836d1e-85d4-4441-a14e-60cb3c80bdca",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[34m\u001b[1mwandb\u001b[0m: Appending key for api.wandb.ai to your netrc file: /root/.netrc\n"
     ]
    }
   ],
   "source": [
    "!wandb login 9c72500db18bf63da3b378014d8ef5a96b0d98f0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "985dc78f-e7bd-4df9-a9d5-58c137172c58",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Configuration already exists at /root/.cache/huggingface/accelerate/default_config.yaml, will not override. Run `accelerate config` manually or pass a different `save_location`.\n"
     ]
    }
   ],
   "source": [
    "! accelerate config default \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "c9b1c445-9d77-47b8-a64a-f081b23f8ef7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: https://download.pytorch.org/whl/cu121\n",
      "Collecting xformers\n",
      "  Downloading https://download.pytorch.org/whl/cu121/xformers-0.0.24-cp310-cp310-manylinux2014_x86_64.whl (218.2 MB)\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m218.2/218.2 MB\u001b[0m \u001b[31m21.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
      "\u001b[?25hRequirement already satisfied: numpy in /opt/conda/lib/python3.10/site-packages (from xformers) (1.26.3)\n",
      "Requirement already satisfied: torch==2.2.0 in /opt/conda/lib/python3.10/site-packages (from xformers) (2.2.0)\n",
      "Requirement already satisfied: filelock in /opt/conda/lib/python3.10/site-packages (from torch==2.2.0->xformers) (3.13.1)\n",
      "Requirement already satisfied: typing-extensions>=4.8.0 in /opt/conda/lib/python3.10/site-packages (from torch==2.2.0->xformers) (4.9.0)\n",
      "Requirement already satisfied: sympy in /opt/conda/lib/python3.10/site-packages (from torch==2.2.0->xformers) (1.12)\n",
      "Requirement already satisfied: networkx in /opt/conda/lib/python3.10/site-packages (from torch==2.2.0->xformers) (3.1)\n",
      "Requirement already satisfied: jinja2 in /opt/conda/lib/python3.10/site-packages (from torch==2.2.0->xformers) (3.1.2)\n",
      "Requirement already satisfied: fsspec in /opt/conda/lib/python3.10/site-packages (from torch==2.2.0->xformers) (2023.12.2)\n",
      "Requirement already satisfied: MarkupSafe>=2.0 in /opt/conda/lib/python3.10/site-packages (from jinja2->torch==2.2.0->xformers) (2.1.3)\n",
      "Requirement already satisfied: mpmath>=0.19 in /opt/conda/lib/python3.10/site-packages (from sympy->torch==2.2.0->xformers) (1.3.0)\n",
      "Installing collected packages: xformers\n",
      "Successfully installed xformers-0.0.24\n",
      "\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n",
      "\u001b[0m"
     ]
    }
   ],
   "source": [
    "!pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "3cd0de54-e6db-40b1-9d66-f326a27161e4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "python: /usr/share/python /opt/conda/bin/python\n"
     ]
    }
   ],
   "source": [
    "!whereis python"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "ce6bff0e-374d-46c6-9ac3-7987935d5c46",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/opt/conda/bin/python\n"
     ]
    }
   ],
   "source": [
    "!which python"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "0cf55c4d-ef26-4ffd-a77a-3630de94442e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Python 3.10.13\n"
     ]
    }
   ],
   "source": [
    "!python --version"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "e708f16c-0525-4bd5-9fe9-267713aa8a54",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "loading annotations from /root/merged_run_021124/animdiff_training_021024_synced2_reresmpl_train_val.csv ...\n",
      "Traceback (most recent call last):\n",
      "  File \"/root/animation_training/src/latte/datasets/gameanim_image_datasets.py\", line 186, in <module>\n",
      "    for ivd, video_data in enumerate(ffs_dataloader):\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 631, in __next__\n",
      "    data = self._next_data()\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 1346, in _next_data\n",
      "    return self._process_data(data)\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 1372, in _process_data\n",
      "    data.reraise()\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/_utils.py\", line 722, in reraise\n",
      "    raise exception\n",
      "RuntimeError: Caught RuntimeError in DataLoader worker process 0.\n",
      "Original Traceback (most recent call last):\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py\", line 308, in _worker_loop\n",
      "    data = fetcher.fetch(index)\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py\", line 51, in fetch\n",
      "    data = [self.dataset[idx] for idx in possibly_batched_index]\n",
      "  File \"/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py\", line 51, in <listcomp>\n",
      "    data = [self.dataset[idx] for idx in possibly_batched_index]\n",
      "  File \"/root/animation_training/src/latte/datasets/gameanim_image_datasets.py\", line 140, in __getitem__\n",
      "    video_cat = torch.cat([video, images], dim=0)\n",
      "RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 599 but got size 256 for tensor number 1 in the list.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "!python datasets/gameanim_image_datasets.py #--image_size 512"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9102eadc-dbeb-4fb7-ba91-4f9f1de0cb17",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
